import { request } from './request'
//获取轮播图
export function getBanner() {
    return request({
        url: '/banner',
        params: {

        }
    })
}

//获取推荐歌单
export function getRec() {
    return request({
        url: '/top/playlist',
        params: {
            offset: (Math.random() * 1297).toFixed(0) - 12,
            limit: 20,
        }
    })
}

//获取独家放送
export function getPrivate() {
    return request({
        url: '/personalized/privatecontent',
        params: {
        }
    })
}

//获取最新音乐
export function getNewSong() {
    return request({
        url: '/personalized/newsong',
        params: {
            limit: 12
        }
    })
}

//获取mv推荐
export function getMvRecomList() {
    return request({
        url: '/personalized/mv',
        params: {
        }
    })
}

//获取标签
export function getTags() {
    return request({
        url: '/playlist/highquality/tags',
        params: {
        }
    })
}
//获取歌单列表
export function getGoodMusicList(cat) {
    return request({
        url: '/top/playlist/highquality',
        params: {
            cat
        }
    })
}

//获取排行榜信息
export function getRank() {
    return request({
        url: '/toplist',
        params: {
        }
    })
}

//获取歌手榜信息
export function getSinger(type) {
    return request({
        url: '/toplist/artist',
        params: {
            type
        }
    })
}

//获取新歌速递信息
export function getNewMusic(type) {
    return request({
        url: '/top/song',
        params: {
            type
        }
    })
}

//获取音乐链接
export function getMusicUrl(id) {
    return request({
        url: '/song/url?cookie='+sessionStorage.getItem("cookie"),
        params: {
            id
        }
    })
}

//获取歌手信息
export function getSingerDetail(id) {
    return request({
        url: '/artists?cookie='+sessionStorage.getItem("cookie"),
        params: {
            id
        }
    })
}


//获取歌手专辑信息
export function getSingerAblum(id) {
    return request({
        url: '/artist/album',
        params: {
            id
        }
    })
}


//获取歌手mv信息
export function getSingerMv(id) {
    return request({
        url: '/artist/mv',
        params: {
            id
        }
    })
}


//获取歌手详情信息
export function getSingerInfo(id) {
    return request({
        url: '/artist/detail',
        params: {
            id
        }
    })
}


//获取相似歌手信息
export function getSameSinger(id) {
    return request({
        url: '/simi/artist',
        params: {
            id
        }
    })
}
//获取专辑详情
export function getAlbumDetail(id) {
    return request({
        url: '/album?cookie='+sessionStorage.getItem("cookie"),
        params: {
            id
        }
    })
}

//获取专辑部分信息
export function getAlbumInfo(id) {
    return request({
        url: '/album/detail/dynamic',
        params: {
            id
        }
    })
}
//获取专辑评论信息
export function getAlbumComment(id, limit) {
    return request({
        url: '/comment/album?cookie='+sessionStorage.getItem("cookie"),
        params: {
            id,
            limit
        }
    })
}

//获取搜索歌曲列表信息
export function getSearchList(keywords,limit,offset,type) {
    return request({
        url: '/cloudsearch',
        params: {
            keywords,
            limit,
            offset,
            type
        }
    })
}

//获取搜索建议
export function getSearchSuggest(keywords) {
    return request({
        url: '/search/suggest',
        params: {
            keywords,
        }
    })
}

//收藏/取消收藏歌单
export function getSubscribe(t,id) {
    return request({
        url: '/playlist/subscribe?cookie='+sessionStorage.getItem("cookie"),
        params: {
            t,
            id
        }
    })
}

//收藏/取消收藏专辑
export function getAlbumSubscribe(t,id) {
    return request({
        url: '/album/sub?cookie='+sessionStorage.getItem("cookie"),
        params: {
            t,
            id
        }
    })
}

//获取搜索历史
export function getSearchHistory() {
    return request({
        url: '/search/default?cookie='+sessionStorage.getItem("cookie"),
        params: {
        }
    })
}
